package com.yihuan.service;

import com.yihuan.entity.SellerEntity;
import com.yihuan.mapper.SellerMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author:梦醒
 * Date: 2022/4/18 20:54
 * Dream:
 * 信言不美，美言不信。
 * 善者不辩，辩者不善。
 * 知者不博，博者不知。
 * Function:
 */
@Service
public class SellerService {
    @Resource
    SellerMapper sellerMapper;
    
    //登录账号
    public List<SellerEntity> findSellerBySellerLoginNameAndSellerPassword(SellerEntity sellerEntity) {
        return sellerMapper.findSellerBySellerLoginNameAndSellerPassword(sellerEntity);
    }
    
    //根据商户账号判断是否存在
    public List<SellerEntity> findSellerBySellerLoginName(SellerEntity sellerEntity) {
        return sellerMapper.findSellerBySellerLoginName(sellerEntity);
    }
    
    //注册商户信息
    public int insertSellerBySellerData(SellerEntity sellerEntity) {
        return sellerMapper.insertSellerBySellerData(sellerEntity);
    }
    
    //更改商户信息
    public int updateSellerBySellerPassword(SellerEntity sellerEntity) {
        return sellerMapper.updateSellerBySellerPassword(sellerEntity);
    }
    
    //修改公司编号
    public int updateSellerByCompID(SellerEntity sellerEntity) {
        return sellerMapper.updateSellerByCompID(sellerEntity);
    }
    
    //分页查询数据
    public List<SellerEntity> findSellerBySellerList(SellerEntity sellerEntity) {
        return sellerMapper.findSellerBySellerList(sellerEntity);
    }
    
    //统计分页查询数据
    public int countSellerList() {
        return sellerMapper.countSellerList();
    }
    
    //模糊分页查询数据
    public List<SellerEntity> findSellerBySellerConcatList(SellerEntity sellerEntity) {
        return sellerMapper.findSellerBySellerConcatList(sellerEntity);
    }
    
    //模糊统计分页查询数据
    public int countSellerConcatList(SellerEntity sellerEntity) {
        return sellerMapper.countSellerConcatList(sellerEntity);
    }
    
    //更改商户信息状态
    public int updateSellerBySellerState(SellerEntity sellerEntity) {
        return sellerMapper.updateSellerBySellerState(sellerEntity);
    }
    
    /**
     * 个人信息
     *
     * @param sellerEntity
     * @return
     */
    public List<SellerEntity> findSellerBySellerID(SellerEntity sellerEntity) {
        return sellerMapper.findSellerBySellerID(sellerEntity);
    }
}
